<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form:form method="post" modelAttribute="itemListVO">
		<table class="table1">
			<tr>
				<th>ITEM NAME</th>
				<th>BRAND NAME</th>
			</tr>
			<c:forEach var="item" items="${itemListVO.itemList}" varStatus="i">
				<tr>
					<td class="td1"><form:input path="itemList[${i.index}].itemName" /></td>
					<td class="td2">
						<form:select path="itemList[${i.index}].brand.brandId">
							<form:option value="0" label="-SELECT A BRAND-"/>
							<c:forEach items="${brandNameList}" var="brandEntry">
								<form:option label="${brandEntry.brandName}" value="${brandEntry.brandId}"></form:option>
							</c:forEach>
						</form:select>
					</td>
				</tr>
			</c:forEach> 
			<tr>
				<td><input type="submit" value="SUBMIT"></td>
				<td><input type="button" value="CANCEL"></input></td>
			</tr>
		</table>
	</form:form>
</body>
</html>